package com.abigdreamer.newspider;

/**
 * 
 * @author Darkness
 * @date 2013-2-6 下午10:22:56
 * @website http://www.abigdreamer.com
 * @version V1.0
 */
public class Article {

	private String id;
	
	private String title;
	private String url;
	private String content;
	
	public Article() {
	}

	public Article(String title, String content) {
		this.title = title;
		this.content = content;
	}
	
	public static void main(String[] args) {
		System.out.println("http://hkbici.com/forum-2-1.html".split("com/")[1].replace(".html", ""));
	}
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
		this.id = url.split("com/")[1].replace(".html", "");
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	@Override
	public String toString() {
		return 
		"<article>" +
			"<id>"+id+"</id>" +
			"<title>" +
				"<![CDATA[" + title + "]]>" +
			"</title>" +
			"<url>" +
				"<![CDATA[" + url + "]]>" +
			"</url>" +
//			"<content>" +
//				"<![CDATA[" + content+ "]]>" +
//			"</content>" +
		"</article>";
	}

}
